\hypertarget{classsc2_1_1_s_c2_type}{}\section{sc2\+:\+:S\+C2\+Type$<$ T $>$ Class Template Reference}
\label{classsc2_1_1_s_c2_type}\index{sc2\+::\+S\+C2\+Type$<$ T $>$@{sc2\+::\+S\+C2\+Type$<$ T $>$}}


{\ttfamily \#include $<$sc2\+\_\+types.\+h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_a797ecedf348b295b1827f6cd875843e7}\label{classsc2_1_1_s_c2_type_a797ecedf348b295b1827f6cd875843e7}} 
\hyperlink{classsc2_1_1_s_c2_type_a797ecedf348b295b1827f6cd875843e7}{S\+C2\+Type} ()
\begin{DoxyCompactList}\small\item\em Default constructor. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_adda8c2ecd47bf1fe93ad54726404674f}\label{classsc2_1_1_s_c2_type_adda8c2ecd47bf1fe93ad54726404674f}} 
\hyperlink{classsc2_1_1_s_c2_type_adda8c2ecd47bf1fe93ad54726404674f}{S\+C2\+Type} (uint32\+\_\+t type\+\_\+id)
\begin{DoxyCompactList}\small\item\em Construct from an integer, corresponds to the enum value. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_ac956d32e3d7989b2e0ab2664c9822d16}\label{classsc2_1_1_s_c2_type_ac956d32e3d7989b2e0ab2664c9822d16}} 
\hyperlink{classsc2_1_1_s_c2_type_ac956d32e3d7989b2e0ab2664c9822d16}{S\+C2\+Type} (T type\+\_\+id)
\begin{DoxyCompactList}\small\item\em Construct from the enum. \end{DoxyCompactList}\item 
bool \hyperlink{classsc2_1_1_s_c2_type_a499b06e107c0561ce3d2d80094fbdd94}{operator==} (\hyperlink{classsc2_1_1_s_c2_type}{S\+C2\+Type}$<$ T $>$ type\+\_\+id) const
\item 
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_a404a385de418d89ea84344d9ac7fd728}\label{classsc2_1_1_s_c2_type_a404a385de418d89ea84344d9ac7fd728}} 
bool {\bfseries operator==} (T type\+\_\+id) const
\item 
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_a4dcadbfd52b9acde5f49b2d452ac08fa}\label{classsc2_1_1_s_c2_type_a4dcadbfd52b9acde5f49b2d452ac08fa}} 
bool {\bfseries operator==} (uint32\+\_\+t type\+\_\+id) const
\item 
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_ade586b36531920f32527128774df00b7}\label{classsc2_1_1_s_c2_type_ade586b36531920f32527128774df00b7}} 
bool {\bfseries operator==} (int type\+\_\+id) const
\item 
bool \hyperlink{classsc2_1_1_s_c2_type_a6e032550a699843364b52d9f30d7ddcc}{operator!=} (\hyperlink{classsc2_1_1_s_c2_type}{S\+C2\+Type}$<$ T $>$ type\+\_\+id) const
\item 
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_af18f2a54f07829ae2cc8501301f1764f}\label{classsc2_1_1_s_c2_type_af18f2a54f07829ae2cc8501301f1764f}} 
bool {\bfseries operator!=} (T type\+\_\+id) const
\item 
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_afa64fdd5adf5eca49d3a95826e884fa1}\label{classsc2_1_1_s_c2_type_afa64fdd5adf5eca49d3a95826e884fa1}} 
bool {\bfseries operator!=} (uint32\+\_\+t type\+\_\+id) const
\item 
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_a8195d6f42d7e7c193bf08dbd146ef22c}\label{classsc2_1_1_s_c2_type_a8195d6f42d7e7c193bf08dbd146ef22c}} 
bool {\bfseries operator!=} (int type\+\_\+id) const
\item 
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_a9ad0dc8b2a47eca60fa3a49c9c2e5de0}\label{classsc2_1_1_s_c2_type_a9ad0dc8b2a47eca60fa3a49c9c2e5de0}} 
bool \hyperlink{classsc2_1_1_s_c2_type_a9ad0dc8b2a47eca60fa3a49c9c2e5de0}{operator$<$} (const \hyperlink{classsc2_1_1_s_c2_type}{S\+C2\+Type}$<$ T $>$ \&other) const
\begin{DoxyCompactList}\small\item\em Test comparison. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_ab75e39605288070327604d10a5f720bf}\label{classsc2_1_1_s_c2_type_ab75e39605288070327604d10a5f720bf}} 
\hyperlink{classsc2_1_1_s_c2_type_ab75e39605288070327604d10a5f720bf}{operator uint32\+\_\+t} () const
\begin{DoxyCompactList}\small\item\em Cast to integer. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_a16ef14791e484bcb2708d262fbfbc46f}\label{classsc2_1_1_s_c2_type_a16ef14791e484bcb2708d262fbfbc46f}} 
\hyperlink{classsc2_1_1_s_c2_type_a16ef14791e484bcb2708d262fbfbc46f}{operator T} () const
\begin{DoxyCompactList}\small\item\em Cast to enum type. \end{DoxyCompactList}\item 
bool \hyperlink{classsc2_1_1_s_c2_type_a359fd3f5911b611089dac072f2ba528f}{Is\+Valid} () const
\item 
std\+::string \hyperlink{classsc2_1_1_s_c2_type_a25533b72e301be4064d80a13c82dc506}{to\+\_\+string} () const
\item 
T \hyperlink{classsc2_1_1_s_c2_type_ada2d70972edaa615780f86165b7e87a3}{To\+Type} () const
\end{DoxyCompactItemize}


\subsection{Detailed Description}
\subsubsection*{template$<$class T$>$\newline
class sc2\+::\+S\+C2\+Type$<$ T $>$}

Template class for defining common game enum types. The template parameter is the enum. This class allows for seamless conversion between enum types and integers, while maintaining strong typing. This means, for example, that a unit type ID can be converted back and forth from an integer, but can\textquotesingle{}t be used when another type ID, e.\+g., an ability ID, is required as a parameter. 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_a359fd3f5911b611089dac072f2ba528f}\label{classsc2_1_1_s_c2_type_a359fd3f5911b611089dac072f2ba528f}} 
\index{sc2\+::\+S\+C2\+Type@{sc2\+::\+S\+C2\+Type}!Is\+Valid@{Is\+Valid}}
\index{Is\+Valid@{Is\+Valid}!sc2\+::\+S\+C2\+Type@{sc2\+::\+S\+C2\+Type}}
\subsubsection{\texorpdfstring{Is\+Valid()}{IsValid()}}
{\footnotesize\ttfamily template$<$class T$>$ \\
bool \hyperlink{classsc2_1_1_s_c2_type}{sc2\+::\+S\+C2\+Type}$<$ T $>$\+::Is\+Valid (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Determines if the value contained is valid. \begin{DoxyReturn}{Returns}
\textquotesingle{}true\textquotesingle{} if the value is valid. 
\end{DoxyReturn}
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_a6e032550a699843364b52d9f30d7ddcc}\label{classsc2_1_1_s_c2_type_a6e032550a699843364b52d9f30d7ddcc}} 
\index{sc2\+::\+S\+C2\+Type@{sc2\+::\+S\+C2\+Type}!operator"!=@{operator"!=}}
\index{operator"!=@{operator"!=}!sc2\+::\+S\+C2\+Type@{sc2\+::\+S\+C2\+Type}}
\subsubsection{\texorpdfstring{operator"!=()}{operator!=()}}
{\footnotesize\ttfamily template$<$class T$>$ \\
bool \hyperlink{classsc2_1_1_s_c2_type}{sc2\+::\+S\+C2\+Type}$<$ T $>$\+::operator!= (\begin{DoxyParamCaption}\item[{\hyperlink{classsc2_1_1_s_c2_type}{S\+C2\+Type}$<$ T $>$}]{type\+\_\+id }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Test non-\/equivalence. \begin{DoxyReturn}{Returns}
\textquotesingle{}true\textquotesingle{} if the values are not equal. 
\end{DoxyReturn}
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_a499b06e107c0561ce3d2d80094fbdd94}\label{classsc2_1_1_s_c2_type_a499b06e107c0561ce3d2d80094fbdd94}} 
\index{sc2\+::\+S\+C2\+Type@{sc2\+::\+S\+C2\+Type}!operator==@{operator==}}
\index{operator==@{operator==}!sc2\+::\+S\+C2\+Type@{sc2\+::\+S\+C2\+Type}}
\subsubsection{\texorpdfstring{operator==()}{operator==()}}
{\footnotesize\ttfamily template$<$class T$>$ \\
bool \hyperlink{classsc2_1_1_s_c2_type}{sc2\+::\+S\+C2\+Type}$<$ T $>$\+::operator== (\begin{DoxyParamCaption}\item[{\hyperlink{classsc2_1_1_s_c2_type}{S\+C2\+Type}$<$ T $>$}]{type\+\_\+id }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Test equivalence. \begin{DoxyReturn}{Returns}
\textquotesingle{}true\textquotesingle{} if the values are equal. 
\end{DoxyReturn}
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_a25533b72e301be4064d80a13c82dc506}\label{classsc2_1_1_s_c2_type_a25533b72e301be4064d80a13c82dc506}} 
\index{sc2\+::\+S\+C2\+Type@{sc2\+::\+S\+C2\+Type}!to\+\_\+string@{to\+\_\+string}}
\index{to\+\_\+string@{to\+\_\+string}!sc2\+::\+S\+C2\+Type@{sc2\+::\+S\+C2\+Type}}
\subsubsection{\texorpdfstring{to\+\_\+string()}{to\_string()}}
{\footnotesize\ttfamily template$<$class T$>$ \\
std\+::string \hyperlink{classsc2_1_1_s_c2_type}{sc2\+::\+S\+C2\+Type}$<$ T $>$\+::to\+\_\+string (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

String of the integer value. \begin{DoxyReturn}{Returns}
The string of the value. 
\end{DoxyReturn}
\mbox{\Hypertarget{classsc2_1_1_s_c2_type_ada2d70972edaa615780f86165b7e87a3}\label{classsc2_1_1_s_c2_type_ada2d70972edaa615780f86165b7e87a3}} 
\index{sc2\+::\+S\+C2\+Type@{sc2\+::\+S\+C2\+Type}!To\+Type@{To\+Type}}
\index{To\+Type@{To\+Type}!sc2\+::\+S\+C2\+Type@{sc2\+::\+S\+C2\+Type}}
\subsubsection{\texorpdfstring{To\+Type()}{ToType()}}
{\footnotesize\ttfamily template$<$class T$>$ \\
T \hyperlink{classsc2_1_1_s_c2_type}{sc2\+::\+S\+C2\+Type}$<$ T $>$\+::To\+Type (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}

Explicit conversion to the enum type. \begin{DoxyReturn}{Returns}
The enum. 
\end{DoxyReturn}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
include/sc2api/\hyperlink{sc2__types_8h}{sc2\+\_\+types.\+h}\end{DoxyCompactItemize}
